package com.qisu.command;

import javax.annotation.PostConstruct;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import com.qisu.util.ByteArrayUtils;

import io.netty.channel.ChannelHandlerContext;

/**
 *
 * @author alsan
 *
 */
@Component
public class CommandUnknown extends AbstractCommand {
	private Logger _log = LoggerFactory.getLogger(getClass());

	@PostConstruct
	@Override
	protected void init() {
		super.init();

		fieldsList.addField("preserved1", new CommandFieldDef<Integer>(2));
		fieldsList.addField("preserved2", new CommandFieldDef<Integer>(2));
	}

	@Override
	protected void processCmd(ChannelHandlerContext ctx, byte[] req) {
		_log.warn("unknown command received, or command is not yet implement: " + ByteArrayUtils.hexString(req));
	}

	@Override
	protected void responseClient(ChannelHandlerContext ctx) {
		// nothing todo
	}

}
